﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Dala.Samples
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                SiteMapDataSource ds = new SiteMapDataSource();
                ds.ShowStartingNode = false;
                repSampleItems.DataSource = ds;
                repSampleItems.DataBind();
            }
        }

        public string GetImageUrl(string category)
        {
            string imgUrl = string.Empty;
            switch (category)
            {
                case "JS": imgUrl = "~/App_Themes/default/images/cat-js-icon.png"; break;
                case "HTML": imgUrl = "~/App_Themes/default/images/cat-html-icon.png"; break;
                case "CODE_SAMPLE": imgUrl = "~/App_Themes/default/images/cat-code-icon.png"; break;
            }

            return imgUrl;
        }
    }
}
